import request from '@/config/axios'

// 客户分类 VO
export interface CusclassVO {
  id: number // 主键id
  code: string // 分类编码
  name: string // 分类名称
  parentId: number // 父ID
}

// 客户分类 API
export const CusclassApi = {
  // 查询客户分类列表
  getCusclassList: async (params) => {
    return await request.get({ url: `/wms/cusclass/list`, params })
  },

  // 查询客户分类详情
  getCusclass: async (id: number) => {
    return await request.get({ url: `/wms/cusclass/get?id=` + id })
  },

  // 新增客户分类
  createCusclass: async (data: CusclassVO) => {
    return await request.post({ url: `/wms/cusclass/create`, data })
  },

  // 修改客户分类
  updateCusclass: async (data: CusclassVO) => {
    return await request.put({ url: `/wms/cusclass/update`, data })
  },

  // 删除客户分类
  deleteCusclass: async (id: number) => {
    return await request.delete({ url: `/wms/cusclass/delete?id=` + id })
  },

  // 导出客户分类 Excel
  exportCusclass: async (params) => {
    return await request.download({ url: `/wms/cusclass/export-excel`, params })
  },
}
